package bpm.dao.impl.agenda;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import bpm.domain.agenda.Leader;
/**
 * 
 * @author ZhaoWangLong Dec 13, 2011
 *
 */
public class LeaderRowMapper implements RowMapper {
	private boolean all=true;
	public LeaderRowMapper(){}
	public LeaderRowMapper(boolean all){
		this.all=all;
	}

	public Object mapRow(ResultSet rs, int i) throws SQLException {
		Leader leader = new Leader();
		leader.setLeaderId(rs.getString("LEADER_ID"));
		leader.setLeaderName(rs.getString("LEADER_NAME"));
		if(all){
			leader.setIndex(rs.getInt("INDEX"));
			leader.setCreateTime(rs.getDate("CREATE_TIME"));
			leader.setUpdateTime(rs.getDate("UPDATE_TIME"));
		}
		return leader;
	}

}
